<?php 
$appId='wx_zhiguang';
$appSecret='wn22d01hged73s82le';
 
$url='http://test-sweixinapi.hisense.com/openapi/token?grant_type=client_credential&appid='.$appId.'&secret='.$appSecret;

echo $url;
echo "<br />";

$data=json_decode(httpGet($url),true);
$hai_token=$data['access_token'];
echo "<br />";


$url='http://test-sweixinapi.hisense.com/interface/weChatExternal/qryAccessToken?access_token='.$hai_token;

echo $url;
echo "<br />";
echo "<br />";
$data=json_decode(httpGet($url),true);
var_dump($data);
$access_token=$data['data'];
echo "<br />";
echo "<br />";
echo "<br />";

$url='http://test-sweixinapi.hisense.com/interface/weChatExternal/qryCardTicket?access_token='.$hai_token;
echo $url;
echo "<br />";
$data=json_decode(httpGet($url),true);
echo "<br />";
var_dump($data);

function httpGet($url) {
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($curl, CURLOPT_TIMEOUT, 500);
    curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
    curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
    curl_setopt($curl, CURLOPT_URL, $url);
    
    $res = curl_exec($curl);
    curl_close($curl);
    var_dump($res);
    
    return $res;
}


?>